package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class LoginPage {
    @RequestMapping("/login")
    public String getEmployeePage() {
        return "login";
    }

    @RequestMapping({"/", "/**/*"})
    public String defaultPage(HttpSession session) {
        if (session.getAttribute("login_confirm") != null) {
            return "redirect:/main";
        } else {
            return "redirect:/login";
        }
    }
}
